package com.jh.sms;

import java.util.Observable;
import java.util.concurrent.ConcurrentHashMap;

public class DataObservable extends Observable {

	private  ConcurrentHashMap<String,SmsHandler>  clientMap;
	
	public DataObservable(ConcurrentHashMap<String,SmsHandler> clientMap){
		this.clientMap=clientMap;
	}
	
	public synchronized void putClientMap(String key,SmsHandler handler){
		clientMap.put(key, handler);
		setChanged();
		this.notifyObservers(clientMap);
	}
	public static void main(String[] args) {
		
	}
	public ConcurrentHashMap<String, SmsHandler> getClientMap() {
		return clientMap;
	}
	public void setClientMap(ConcurrentHashMap<String, SmsHandler> clientMap) {
		this.clientMap = clientMap;
	}

}
